<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>剩余参数</title>
	</head>
	<body>
		<script>
			// const sum = (...args) => {
			// 	let total = 0;
			// 	args.forEach((item) => {
			// 		total += item;
			// 	});
			// 	return total;
			// };

			// console.log(sum(10, 20));

			let arr = ['vae', 'uae', 'oae'];
			let [s1, ...s2] = arr;
			console.log(s1);
			console.log(s2);
		</script>
	</body>
</html>
